/**
 * @file 账单管理 api
 * @author lishaohai
 */

import request from '@/utils/request';

// 账单管理 => 获取账单列表
export function getBillList(params) {
    return request({method: 'get', url: '/api/bills/', params});
}

// 账单管理 => 新建账单
export function postBillList(data) {
    return request({method: 'post', url: '/api/bills/', data});
}

// 账单管理 => 修改账单
export function putBillList(id, data) {
    return request({method: 'put', url: `/api/bills/${id}/`, data});
}

// 账单管理 => 批量修改账单
export function putBillsList(data) {
    return request({method: 'put', url: '/api/bills/', data});
}

// 账单管理 => 账单详情 => 获取单个账单信息
export function getBill(id) {
    return request({method: 'get', url: `/api/bills/${id}/`});
}

// 账单管理 => 删除账单
export function deleteBill(id) {
    return request({method: 'delete', url: `/api/bills/${id}/`});
}

// 账单管理 => 批量删除账单
export function deleteBills(data) {
    return request({method: 'delete', url: '/api/bills/', data});
}

// 账单管理 借款平台
export function getBillPlatforms(params) {
    return request({method: 'get', url: '/api/platforms/', params});
}
export function postBillPlatforms(data) {
    return request({method: 'post', url: '/api/platforms/', data});
}
export function putBillPlatforms(data) {
    return request({method: 'put', url: '/api/platforms/', data});
}

export function getBillPlatform(id) {
    return request({method: 'get', url: `/api/platforms/${id}/`});
}
export function putBillPlatform(id, data) {
    return request({method: 'put', url: `/api/platforms/${id}/`, data});
}
export function deleteBillPlatform(id) {
    return request({method: 'delete', url: `/api/platforms/${id}/`});
}
